﻿using Basic.FlowRemoteModel;
using Basic.FlowRemoteModel.FlowNode.Model;
using SqlSugar;

namespace Basic.FlowModel.Node
{
    public class NodeData
    {
        public long Id
        {
            get;
            set;
        }

        public string NodeName
        {
            get;
            set;
        }

        public FlowNodeType NodeType
        {
            get;
            set;
        }
        public FlowAuditType AuditType
        {
            get;
            set;
        }
        public long? FormId
        {
            get;
            set;
        }
        /// <summary>
        /// 审核限制时间(分)
        /// </summary>
        public short? LimitTime
        {
            get;
            set;
        }

        /// <summary>
        /// 是否签名
        /// </summary>
        public bool IsSign
        {
            get;
            set;
        }
        /// <summary>
        /// 是否可上传文件
        /// </summary>
        public bool IsUpFile
        {
            get;
            set;
        }
        /// <summary>
        /// 是否对上传文件数字签名
        /// </summary>
        public bool IsUpFileSign
        {
            get;
            set;
        }
        /// <summary>
        /// 审批意见是否必填
        /// </summary>
        public bool OpinionMust
        {
            get;
            set;
        }
        /// <summary>
        /// 会签最小通过数
        /// </summary>
        public short? MinAuditPass
        {
            get;
            set;
        }
        /// <summary>
        /// 会签通过数是否按照比例计算
        /// </summary>
        public bool IsRatio
        {
            get;
            set;
        }
        /// <summary>
        /// 会审未通过时
        /// </summary>
        public FlowOutNoPassOptMethod AuditNoPassOpt
        {
            get;
            set;
        }
        /// <summary>
        /// 进度值
        /// </summary>
        public short? ProgressVal
        {
            get;
            set;
        }
        /// <summary>
        /// 是否允许撤回
        /// </summary>
        public bool IsAllowCancel
        {
            get;
            set;
        }
        /// <summary>
        /// 是否允许编辑
        /// </summary>
        public bool IsAllowEdit
        {
            get;
            set;
        }
        public FlowAuditButton AuditButton
        {
            get;
            set;
        }
        /// <summary>
        /// 回退到的节点ID 为空=选择回退节点
        /// </summary>
        public long? BackNodeId
        {
            get;
            set;
        }
        /// <summary>
        /// 回退处理方式
        /// </summary>
        public FlowBackMethod BackMethod
        {
            get;
            set;
        }
        /// <summary>
        /// 节点进入的条件
        /// </summary>
        public FlowNodeIntoCondition IntoCondition
        {
            get;
            set;
        }
        public long? IntoWaitNodeId
        {
            get;
            set;
        }
        /// <summary>
        /// 节点进入的最小通过人数
        /// </summary>
        public short? IntoMinPassNum
        {
            get;
            set;
        }

        [SugarColumn(IsJson = true)]
        public IntoFormula[] IntoFormula
        {
            get;
            set;
        }
        /// <summary>
        /// 节点下发流程走向策略
        /// </summary>
        public FlowNodeOutPolicy OutPolicy
        {
            get;
            set;
        }
        /// <summary>
        /// 出方向条件
        /// </summary>
        public FlowOutCondition OutCondition
        {
            get;
            set;
        }
        /// <summary>
        /// 出方向子流程最小通过数
        /// </summary>
        public short? OutMinPassNum
        {
            get;
            set;
        }
        public long? OutWaitNodeId
        {
            get;
            set;
        }
        /// <summary>
        /// 是否等待通过后继续
        /// </summary>
        public bool OutIsWaitPass
        {
            get;
            set;
        }
        /// <summary>
        /// 节点出时子节点审核未通过时的处理方式
        /// </summary>
        public FlowOutNoPassOptMethod OutNoPassOpt
        {
            get;
            set;
        }
        /// <summary>
        /// 节点层级
        /// </summary>
        public int NodeLvl
        {
            get;
            set;
        }
        /// <summary>
        /// 开始节点 如果是子流程 值为子流程节点ID 主流程 值为开始节点ID
        /// </summary>
        public long RootNodeId
        {
            get;
            set;
        }
        /// <summary>
        /// 节点启动方式
        /// </summary>
        public FlowNodeStartMode StartMode
        {
            get;
            set;
        }
        public long? StartFormId
        {
            get;
            set;
        }
        public long? StartColId
        {
            get;
            set;
        }
        /// <summary>
        /// 延迟时间
        /// </summary>
        public int? DelayTime
        {
            get;
            set;
        }
        /// <summary>
        /// 消息通知范围
        /// </summary>
        public FlowMsgNoticeRange NoticeRange
        {
            get;
            set;
        }
    }
}
